package com.gxa.user.service;

import com.gxa.o2o.core.dto.ResultDTO;
import com.gxa.o2o.core.exception.BusinessException;
import com.gxa.o2o.core.pojo.User;
import com.gxa.o2o.core.service.BaseService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 阔爱又迷人的川锅锅呀
 */
public interface UserService extends BaseService<User>  {
//    /**
//     * 根据用户名查询用户
//     * @param name
//     * @return
//     */
//    User findTopByName(String name);
//
//    /**
//     * 根据用户手机号查找用户
//     * @param phone
//     * @return
//     */
//    User findTopByPhone(String phone);

    /**
     * 图片上传接口
     * @param file
     * @param folder
     * @return
     * @throws IOException
     */
    ResultDTO upload(MultipartFile file, String folder) throws IOException;

    /**
     * git第三方登录
     * @return
     */
   void loginByGit(HttpServletResponse response) throws IOException;

    /**
     * 第三方登录回调
     * @param code
     * @param request
     * @return
     */
    ResultDTO callBack(String code, HttpServletRequest request) throws BusinessException;

    /**
     * 用户一键登录
     * @param phone
     * @param code
     * @return
     */
    ResultDTO loginByPhone( String phone,  String code);

    /**
     * 获取手机验证码
     * @param phone
     * @return
     */
    ResultDTO getVerifyCode(String phone) throws BusinessException;

}
